import { request } from "../request";

export const apiSysRolePagePost = (data:any)=>{
    return request({
        url:'/api/sysRole/page',
        method:'POST',
        data
    })
}

export const apiSysRoleOwnOrgListGet = (id:any)=>{
    return request({
        method:"GET",
        url:"/api/sysRole/ownOrgList",
        params:{
            id
        }
    })
}

export const apiSysRoleGrantDataScopePost = (data:any)=>{
    return request({
        url:"/api/sysRole/grantDataScope",
        method:"POST",
        data
    })
}


export const apiSysRoleListGet = ()=>{
    return request({
        url:"/api/sysRole/list",
        method:"GET"
    })
}

export const apiSysRoleOwnMenuListGet = (id: number, status?: number)=>{
    return request({
        method:"GET",
        url:"/api/sysRole/ownMenuList",
        params:{
            id,
            status
        }
    })
}
export const apiSysRoleOwnBtnMenuListGet = (id: number, status?: number)=>{
    return request({
        method:"GET",
        url:"/api/sysRole/ownBtnMenuList",
        params:{
            id,
            status
        }
    })
}
export const apiSysRoleUpdatePost = (data:any)=>{
    return request({
        url:"/api/sysRole/update",
        method:"POST",
        data
    })
}

export const apiSysRoleAddPost = (data:any)=>{
    return request({
        url:"/api/sysRole/add",
        method:"POST",
        data 
    }) 
}

export const apiSysRoleSetStatusPost = (data:any)=>{
    return request({
        url:"/api/sysRole/setStatus",
        method:"POST",
        data
    })
}

export const apiSysRoleDeletePost = (data:any)=>{
    return request({
        url:"/api/sysRole/delete",
        method:"POST",
        data
    })
}

export const apiUpdateRoleBtnMenuPost = (data:any)=>{
    return request({
        url:"/api/sysRole/updateRoleBtnMenu",
        method:"POST",
        data
    })
}